﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/philadmin/Philadmin.Master"
    CodeBehind="ViewCountry.aspx.vb" Inherits="Phila.ViewCountry" %>

<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%--<script type="text/javascript">

        $(function () {

            jQuery("#gridCountry").jqGrid({
                datatype: 'xmlstring',
                //url: 'ViewCountry.aspx/GetCountries',
                datastr: 'GetCountries()%>',
                //url: 'GetCountries()%>',
                mtype: 'Post',
                loadonce: true,
                datatype: 'json',
                colNames: ['Id', 'Name', 'Overview', 'Thumbnail', 'ViewOrder'],
                colModel: [
                            { name: 'Id', width: 100, sortable: true },
                            { name: 'Name', width: 100, sortable: true },
                            { name: 'Overview', width: 100, sortable: true },
                            { name: 'Thumbnail', width: 100, sortable: true },
                            { name: 'ViewOrder', width: 100, sortable: true },
                            ],
                pager: '#pagerCountry',
                rowNum: 10,
                viewrecords: true,
                caption: 'My first grid'
            });

        });
    </script>--%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>
        View Countries</h1>
    <%-- <div class="actions">
        <a href="EditCountry.aspx">Add Country</a></div>
   <asp:GridView ID="gvCountry" runat="server" ShowFooter="True" AutoGenerateColumns="False"
        Width="100%" CssClass="grid">
        <Columns>
            <asp:BoundField HeaderText="Id" DataField="Id" />
            <asp:BoundField HeaderText="Name" DataField="Name" />
            <asp:BoundField HeaderText="Overview" DataField="Overview" />
            <asp:ImageField HeaderText="Image" DataImageUrlField="Thumbnail" DataImageUrlFormatString="~\Images\Img\{0}">
            </asp:ImageField>
            <asp:ButtonField ButtonType="Link" CommandName="Edit" Text="Edit" />
            <asp:ButtonField ButtonType="Link" CommandName="Delete" Text="Delete" />
        </Columns>
    </asp:GridView>--%>
    <%--<div class="grid">
        <table id="gridCountry">
        </table>
        <div id="pagerCountry">
        </div>
    </div>--%>
    <radG:RadGrid ID="radGrid" runat="server" Width="99%" PageSize="20" AllowSorting="True"
        AllowMultiRowSelection="False" AllowPaging="True" ShowGroupPanel="True" AutoGenerateColumns="False"
        GridLines="None" EnableAJAX="true">
        <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
        <MasterTableView Width="100%" GroupLoadMode="Client" GroupsDefaultExpanded="False"
            CommandItemDisplay="Top" DataKeyNames="ID">
            <CommandItemTemplate>
                <table width="100%" border="0">
                    <tr>
                        <td valign="top" align="right">
                            <a href="EditCountry.aspx">
                                <img src="../RadControls/Grid/Skins/AddRecord.gif" align="absmiddle" />Add New</a>
                        </td>
                    </tr>
                </table>
            </CommandItemTemplate>
            <Columns>
                <radG:GridTemplateColumn AllowFiltering="False" Groupable="false" UniqueName="TemplateEditColumn"
                    HeaderText="Edit">
                    <ItemTemplate>
                        <a href="EditCountry.aspx?cid=<%#DataBinder.Eval(Container.DataItem,"ID")%>">
                            <img src="../RadControls/Grid/Skins/Edit.gif" alt="Edit" title="Edit" style="border: 0px;" />
                        </a>
                    </ItemTemplate>
                    <HeaderStyle Width="30px" />
                </radG:GridTemplateColumn>
                <radG:GridBoundColumn SortExpression="Name" HeaderText="Name" HeaderButtonType="TextButton"
                    DataField="Name">
                </radG:GridBoundColumn>
                <radG:GridBoundColumn SortExpression="Overview" HeaderText="Overview" HeaderButtonType="TextButton"
                    DataField="Overview">
                </radG:GridBoundColumn>
                <radG:GridTemplateColumn HeaderText="Image">
                    <ItemTemplate>
                        <img src="../images/img/<%#DataBinder.Eval(Container.DataItem,"Thumbnail")%>" />
                    </ItemTemplate>
                    <HeaderStyle Width="180px" />
                </radG:GridTemplateColumn>
                <radG:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete"
                    ButtonType="ImageButton" ImageUrl="../RadControls/Grid/Skins/Delete.gif" ConfirmText="Are you sure you want to delete this record?">
                    <HeaderStyle Width="30px" />
                </radG:GridButtonColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings AllowGroupExpandCollapse="true">
            <Selecting AllowRowSelect="False" />
        </ClientSettings>
    </radG:RadGrid>
</asp:Content>
